package org.pine.dictionary.bean.excel;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import org.pine.dictionary.common.StatusEnum;
import org.pine.dictionary.util.DateExcelConverter;
import org.pine.dictionary.util.IntegerCodeEnumExcelConverter;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 字典导出数据传输对象
 * </p>
 *
 * @author pine
 * @since 2024-05-16
 */
@Data
public class DictionaryExportDto implements Serializable {
    @Serial
    private static final long serialVersionUID = 73925469567901857L;

    /**
     * 字典ID
     */
    @ExcelProperty("字典ID")
    private String dictionaryId;

    /**
     * 编码
     */
    @ExcelProperty("编码")
    private String code;

    /**
     * 名称
     */
    @ExcelProperty("名称")
    private String name;

    /**
     * 状态: 1=启用，0=禁用
     *
     * @see StatusEnum
     * @see IntegerCodeEnumExcelConverter
     */
    @ExcelProperty(value = "状态", converter = IntegerCodeEnumExcelConverter.class)
    private StatusEnum status;

    /**
     * 备注
     */
    @ExcelProperty("备注")
    private String remark;

    /**
     * 创建人用户名
     */
    @ExcelProperty("创建人用户名")
    private String createUsername;

    /**
     * 更新人用户名
     */
    @ExcelProperty("更新人用户名")
    private String updateUsername;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "创建时间", converter = DateExcelConverter.class)
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ColumnWidth(22)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @ExcelProperty(value = "更新时间", converter = DateExcelConverter.class)
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ColumnWidth(22)
    private LocalDateTime updateTime;
}
